function TooltipPro(tooltip,listing,success){
    $(tooltip).html(success);    
    $(listing).animate({
        marginTop:'40px'
    },500);
    $(tooltip).fadeIn('slow');
}
function TooltipOut(tooltip,listing){
    setInterval(function(){
        $(tooltip).fadeOut('slow');
        $(listing).animate({
            marginTop:'0px'
        });
    },3000);
}
function quickEditUser(id,action,button){
    $current = $(button).closest('.detailuser');
    $thongbao = $current.find('.thongbao');
    $.ajax({
        type:'POST',
        data:{id:id,ajax:1,action:action},
        url:'qEditUser',
        dataType:'json',
        success:function(json){
            if(json.error){
                $thongbao.html('<div class="alert alert-error fade in">'+json.error+'<a class="close" data-dismiss="alert">&times;</a></div>');
            }   
            else if(json.success){
                $thongbao.html('<div class="alert alert-success fade in">'+json.success+'<a class="close" data-dismiss="alert">&times;</a></div>');
                if(action=='active'){
                    $current.find('.btn-group').find('a:first').removeClass('disabled');
                    $current.find('.dropdown-menu').find('li:eq(2)').html('<a href="#" class="banBtn"><i class="icon-ban-circle"></i> Ban</a>');
                }
                else if(action == 'ban'){
                    $current.find('.btn-group').find('a:first').addClass('disabled');
                    $current.find('.dropdown-menu').find('li:eq(2)').html('<a href="#" class="activeBtn"><i class="icon-check"></i> Active</a>');
                }
                else if(action == 'makeAdmin'){
                    $current.find('.dropdown-menu').find('li:eq(4)').html('<a href="#" class="cancelAdmin">Cancel admin</a>');
                }
                else if(action == 'cancelAdmin'){
                    $current.find('.dropdown-menu').find('li:eq(4)').html('<a href="#" class="makeAdmin">Make admin</a>');
                }
                    
            }
        }
    });
}